//
//  network_filter_base.h
//  testpcap
//
//  Created by bugforever on 1/10/15.
//  Copyright (c) 2015 bugforever. All rights reserved.
//

#ifndef __network_filter_base_h
#define __network_filter_base_h

#include "../../Include/interface_network_filter.h"
#include <vector>

class network_filter_base
:public interface_network_filter
{
public:
    network_filter_base( FILTER_ACCEPT_DATATYPE input_type , FILTER_ACCEPT_DATATYPE output_type );
    virtual ~network_filter_base();
    
    virtual bool set_network_filter( interface_network_filter * ptr_obj );
    virtual bool set_parent_network_filter( interface_network_filter * ptr_obj );
    
    virtual void set_event_callback( interface_event_callback * ptr_obj );
    
    virtual void send_network_data( FILTER_ACCEPT_DATATYPE type , void * ptr_data );
    virtual void recv_network_data( FILTER_ACCEPT_DATATYPE type , void * ptr_data );
    
    virtual FILTER_ACCEPT_DATATYPE get_filter_accept_datatype();
    virtual FILTER_ACCEPT_DATATYPE get_filter_output_datatype();
    
protected:
    virtual void process_network_data( FILTER_ACCEPT_DATATYPE type , void * ptr_data ) = 0;
    
    virtual void send_event( int event_type , char * str_event , void * param1 , void * param2 );
    
protected:
    interface_network_filter *  m_ptr_filter;
    interface_network_filter *  m_ptr_parent;
    
    interface_event_callback * m_ptr_event;
    
    FILTER_ACCEPT_DATATYPE m_input_type;
    FILTER_ACCEPT_DATATYPE m_output_type;
    
};

#endif /* defined(__testpcap__network_filter_base__) */
